package com.dailyblue.java.thread.作业;

import lombok.SneakyThrows;

public class DemoD2 implements Runnable {

    private DemoD d;

    public DemoD2(DemoD d) {
        this.d = d;
    }

    @SneakyThrows
    public void run() {
        while (true) {
            boolean b = d.售票();
            if (!b) {
                return;
            }
            /*int time = (int) (Math.random() * 2000 + 10);
            Thread.sleep(time);*/
        }

    }
}
